/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package emf.entity_relationship.model.entityrelationship;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Type Cardinality</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * @see emf.entity_relationship.model.entityrelationship.EntityrelationshipPackage#getTypeCardinality()
 * @model
 * @generated
 */
public enum TypeCardinality implements Enumerator {
	/**
	 * The '<em><b>C1 1</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_1_VALUE
	 * @generated
	 * @ordered
	 */
	C1_1(0, "C1_1", "C1_1"),

	/**
	 * The '<em><b>C1 N</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_N_VALUE
	 * @generated
	 * @ordered
	 */
	C1_N(1, "C1_N", "C1_N"),

	/**
	 * The '<em><b>CN M</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #CN_M_VALUE
	 * @generated
	 * @ordered
	 */
	CN_M(2, "CN_M", "CN_M"),

	/**
	 * The '<em><b>C1 11</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_11_VALUE
	 * @generated
	 * @ordered
	 */
	C1_11(3, "C1_1_1", "C1_1_1"),

	/**
	 * The '<em><b>C1 1N</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_1N_VALUE
	 * @generated
	 * @ordered
	 */
	C1_1N(4, "C1_1_N", "C1_1_N"),

	/**
	 * The '<em><b>C1 NM</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_NM_VALUE
	 * @generated
	 * @ordered
	 */
	C1_NM(5, "C1_N_M", "C1_N_M"),

	/**
	 * The '<em><b>CN MP</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #CN_MP_VALUE
	 * @generated
	 * @ordered
	 */
	CN_MP(6, "CN_M_P", "CN_M_P"),

	/**
	 * The '<em><b>C1</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #C1_VALUE
	 * @generated
	 * @ordered
	 */
	C1(7, "C1", "C1");

	/**
	 * The '<em><b>C1 1</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1 1</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1_1
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int C1_1_VALUE = 0;

	/**
	 * The '<em><b>C1 N</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1 N</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1_N
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int C1_N_VALUE = 1;

	/**
	 * The '<em><b>CN M</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>CN M</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #CN_M
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int CN_M_VALUE = 2;

	/**
	 * The '<em><b>C1 11</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1 11</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1_11
	 * @model name="C1_1_1"
	 * @generated
	 * @ordered
	 */
	public static final int C1_11_VALUE = 3;

	/**
	 * The '<em><b>C1 1N</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1 1N</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1_1N
	 * @model name="C1_1_N"
	 * @generated
	 * @ordered
	 */
	public static final int C1_1N_VALUE = 4;

	/**
	 * The '<em><b>C1 NM</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1 NM</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1_NM
	 * @model name="C1_N_M"
	 * @generated
	 * @ordered
	 */
	public static final int C1_NM_VALUE = 5;

	/**
	 * The '<em><b>CN MP</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>CN MP</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #CN_MP
	 * @model name="CN_M_P"
	 * @generated
	 * @ordered
	 */
	public static final int CN_MP_VALUE = 6;

	/**
	 * The '<em><b>C1</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>C1</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #C1
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int C1_VALUE = 7;

	/**
	 * An array of all the '<em><b>Type Cardinality</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final TypeCardinality[] VALUES_ARRAY =
		new TypeCardinality[] {
			C1_1,
			C1_N,
			CN_M,
			C1_11,
			C1_1N,
			C1_NM,
			CN_MP,
			C1,
		};

	/**
	 * A public read-only list of all the '<em><b>Type Cardinality</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<TypeCardinality> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Type Cardinality</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TypeCardinality get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TypeCardinality result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Type Cardinality</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TypeCardinality getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			TypeCardinality result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Type Cardinality</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static TypeCardinality get(int value) {
		switch (value) {
			case C1_1_VALUE: return C1_1;
			case C1_N_VALUE: return C1_N;
			case CN_M_VALUE: return CN_M;
			case C1_11_VALUE: return C1_11;
			case C1_1N_VALUE: return C1_1N;
			case C1_NM_VALUE: return C1_NM;
			case CN_MP_VALUE: return CN_MP;
			case C1_VALUE: return C1;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private TypeCardinality(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //TypeCardinality
